package cn.z2huo.demo.hello.kafka.model;

import lombok.Data;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.common.TopicPartition;

import java.io.Serial;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *
 * @author z2huo
 */
@Data
public class ThresholdParam implements Serializable {

    @Serial
    private static final long serialVersionUID = -5131682229887283672L;

    private int begin;

    private int end;

    private int count;

    private int threshold;

    private List<ConsumerRecord<String, String>> data = new ArrayList<>();

    private TopicPartition topicPartition;

    public void add(List<ConsumerRecord<String, String>> data) {
        this.data.addAll(data);
    }

}
